{extend name="public:common_index"/}
{block name="main"}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
        </div>
        <div class="panel-body">
            <div class="navbar navbar-default">
                <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return false">
                    <div class="form-group">

                        <label class="control-label" >统计类型</label>
                        <select class="form-control" name="type">
                            <option id="type0" value="">全部</option>
                            <option id="type1" value="1">每小时</option>
                            <option id="type2" value="2">每天</option>
                        </select>

                    </div>
                    <div class="form-group">
                    <label class="control-label">时间筛选</label>
                    <div class="input-group">
                    <input type="text" name="startDate"  autocomplete="off" value="{$Think.get.startDate}" placeholder="选择开始时间"
                    class="form-control timepicker">
                    </div>
                    </div>
                    <div class="form-group">
                    <div class="input-group">
                    <input type="text" name="endDate"  autocomplete="off" value="{$Think.get.endDate}" placeholder="选择结束时间"
                    class="form-control timepicker">
                    </div>
                    </div>
                    <button type="submit" onclick="javascript:document.getElementById('search-form2').submit();"
                            id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选
                    </button>
                    <!--<a href="{:url('examiner_batch')}" class="btn btn-primary pull-right"><i class="fa fa-folder-open-o"></i>批量导入</a>-->
                </form>
            </div>
            <div id="ajax_return">
                <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <td>ID</td>
                                <td>统计时间</td>
                                <td>上次统计时间</td>
                                <td>统计时用户数</td>
                                <td>统计类型</td>
                                <td>男用户活跃人数/(活跃度)</td>
                                <td>女用户活跃人数/(活跃度)</td>
                                <td>距上次统计新增男用户数</td>
                                <td>距上次统计新增女用户数</td>
                            </tr>
                            </thead>
                            <tbody>
                            <!-- 列表循环开始 -->
                            {volist name="rows" id="row" key="key"}
                            <tr>
                                <td>{$row.id}</td>
                                <td>{$row.date}</td>
                                <td>{$row.last_date}</td>
                                <td>{$row.user_total}</td>
                                <td>{if condition="$row.type == 1"} 每小时 {else /} 每天 {/if}</td>
                                <td>{$row.man}/{:bcdiv($row.man,$row.user_total,4)*100}%</td>
                                <td>{$row.woman}/{:bcdiv($row.woman,$row.user_total,4)*100}%</td>
                                <td>{$row.new_man}</td>
                                <td>{$row.new_woman}</td>
                            </tr>
                            {/volist}
                            <!-- 列表循环结束 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
            <div id='pagerarea'>{$pageHTML}</div>
        </div>
    </div>
{/block}

{block name="js"}
<script>
    $(function () {
        var type   = "{$Think.get.type}";
        if(type != ''){
            $('#type'+type).attr('selected',true)
        }


    })

</script>



{/block}



